package com.fpx.metadata.bean.po;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.*;

@Table(name = "columns")
@Data
@ApiModel(value = "列信息")
public class Columns {

    @Id
    @KeySql(useGeneratedKeys = true)
    @ApiModelProperty(value = "id")
    private Long id;

    @Column(name = "table_id")
    @ApiModelProperty(value = "表id")
    private Long tableId;

    @Column(name = "table_schema")
    @ApiModelProperty(value = "库名")
    private String tableSchema;

    @Column(name = "table_name")
    @ApiModelProperty(value = "表名")
    private String tableName;


    @Column(name = "column_name")
    @ApiModelProperty(value = "字段名")
    private String columnName;

    @Column(name = "is_nullable")
    @ApiModelProperty(value = "是否允许为null")
    private String isNullable;

    @Column(name = "data_type")
    @ApiModelProperty(value = "数据类型")
    private String dataType;

    @Column(name = "character_set_name")
    @ApiModelProperty(value = "字符集")
    private String characterSetName;

    @Column(name = "collation_name")
    @ApiModelProperty(value = "排序规则")
    private String collationName;

    @Column(name = "column_key")
    @ApiModelProperty(value = "MUL(可以重复)/PRI（主键）/UNI（唯一约束）")
    private String columnKey;

    @Column(name = "extra")
    @ApiModelProperty(value = "特殊描述")
    private String extra;

    @Column(name = "column_comment")
    @ApiModelProperty(value = "描述")
    private String columnComment;

    @Column(name = "column_default")
    @ApiModelProperty(value = "默认值")
    private String columnDefault;

    @Column(name = "column_type")
    @ApiModelProperty(value = "列类型")
    private String columnType;
}